package Thread.DeathLock;
public class DeathLock {
    public static void main(String[] args) {

    }
}

class Counter{
    private int count = 0;
    public synchronized void add(int n ){
        if (n<0){
            dec(n);
        }else{
            count+=n;
        }
    }

    public synchronized void dec(int n ){
        count-=n;
    }
}

